package introduction.functions

/**
 *@author LikeYouDo
 *@date 2024/12/10 14:10
 */
fun main() {
    operator fun Int.times(str: String) = str.repeat(this)
    // 数字与字符串相乘, 返回字符串重复的次数
    println(2 * "Bye ")

    operator fun String.get(range: IntRange) = substring(range)
    val str = "Always forgive your enemies; nothing annoys them so much."
    println(str[0..14])
}
